package com.sfh.tourist.base;

import android.text.TextUtils;

/**
 * 功能描述:上传文件
 *
 */
public class ProcessFile {
    private String imagUrl;

    private String tag;

    /**-1 上传失败 0 正在上传 1 上传成功*/
    private int status = 0;

    public String getTag() {
        return tag;
    }

    public void setTag(String tag) {
        this.tag = tag;
    }
    /***
     * 正在加载
     * @return
     */
    public void setLoading() {
        status = 0;
    }
    /***
     * 正在加载
     * @return
     */
    public boolean getLoading() {
        return status == 0;
    }
    /***
     * 成功
     * @return
     */
    public boolean getSuccess() {
        return status == 1;
    }
    /***
     * 成功
     * @return
     */
    public void setSuccess() {
        status = 1;
    }
    /***
     * 失败
     * @return
     */
    public boolean getFail() {
        return status == -1;
    }
    /***
     * 失败
     * @return
     */
    public void setFail() {
        status = -1;
    }



    public String getImagUrl() {
        return imagUrl;
    }

    public void setImagUrl(String imagUrl) {
        this.imagUrl = imagUrl;
    }

    @Override
    public int hashCode() {
        return imagUrl.hashCode();
    }

    @Override
    public boolean equals(Object o) {
        return TextUtils.equals(imagUrl,((ProcessFile)o).getImagUrl());
    }
}
